package com.xbfinance.manager.web;

import com.xbfinance.common.util.Prop;
import com.xbfinance.manager.service.BannerPicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.PostConstruct;
import java.util.List;

@Controller
@RequestMapping("/banner")
public class BannerPicController {
    private static Integer cid;
    /*static {
        Prop prop = new Prop("banner-pic-cid.properties");
        cid = prop.getInt("cid");
    }*/
    @PostConstruct
    private void init(){
        Prop prop = new Prop("banner-pic-cid.properties");
        cid = prop.getInt("cid");
    }
    @Autowired
    private BannerPicService bannerPicService;
    @RequestMapping("")
    @ResponseBody
    public List<String> listPicUrl(){
        return bannerPicService.listPicUrl(cid);
    }
}
